<template>
	<view>
		<view @click="tiaozhuan(item)" class="da" v-for="(item,index) in dataList" :key="index">
			<view class="tupian">
				<image src="../../static/static/images/images/link-01.png" mode=""></image>
			</view>
			<view class="wenzi">
				<view class="time">
					{{item.title}}
				</view>
				<view class="wenzizi">
					<text>发表时间&nbsp;&nbsp;{{item.add_time|formatDate}}&nbsp;&nbsp;浏览&nbsp;&nbsp;{{item.click}}</text>.
				</view>
			</view>
			
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				dataList:[]
			}
		},
		onLoad() {
			this.getList()
		},
		methods: {
			async getList() {
				const data = await uni.$Http.get(`getnewslist`)
				console.log(data)
				this.dataList = data.message
			},
			tiaozhuan(item){
				uni.navigateTo({
					url:'../xiangqingyemian/xiangqingyemian?id=' + item.id
				})
			}
		}
	}
</script>

<style>
.tupian{
	height: 180rpx;
	width: 320rpx;
}
.tupian image{
	width: 220rpx;
	height: 180rpx;
}
.time{
	font-size: 34rpx;
}
.wenzi{
	font-size: 32rpx;
}
.da{
	border-bottom: 2px solid #C0352C;
	display: flex;
	margin-bottom: 10rpx;
	/* margin-top: 10px; */
}
</style>
